<!doctype html>
<!--[if lt IE 7]>
<html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]-->
<!--[if IE 7]>
<html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]-->
<!--[if IE 8]>
<html class="no-js lt-ie9" lang=""> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js" lang="en"> <!--<![endif]-->
<head>
    <meta charset="utf-8">
    <title>个人收款支付系统</title>
    <meta content="个人收款支付系统,个人免签支付,个人支付接口,免签约,无需第三方SDK,完全免费,支付宝,微信,移动端支付"
          name="keywords">
    <meta content="个人收款支付系统 个人免签支付 个人支付接口 完全免费 免签约 支付宝转账码 无需第三方SDK 个人支付宝、微信、QQ免签支付 支持移动端支付 无视支付宝风控"
          name="description">
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <link href="favicon.ico" rel="icon" type="image/png">

    <!--<link rel="stylesheet" href="assets/css/swiper.min.css">-->
    <link href="assets/css/animate.css" rel="stylesheet">
    <link href="assets/css/iconfont.css" rel="stylesheet">
    <!--<link rel="stylesheet" href="assets/css/font-awesome.min.css">-->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <!--<link rel="stylesheet" href="assets/css/bootstrap.min.css">-->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
    <!--<link rel="stylesheet" href="assets/css/magnific-popup.css">-->
    <link href="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.1/magnific-popup.min.css" rel="stylesheet">
    <link href="assets/css/bootsnav2.css" rel="stylesheet">

    <!--For Plugins external css-->
    <!--<link rel="stylesheet" href="assets/css/plugins.css" />-->
    <!--Theme custom css -->
    <link href="assets/css/style.css" rel="stylesheet">

    <!--Theme Responsive css-->
    <link href="assets/css/responsive.css" rel="stylesheet"/>

    <link href="assets/css/pay.css" rel="stylesheet">

    <!--<script src="assets/js/vendor/modernizr-2.8.3-respond-1.4.2.min.js"></script>-->
    <!--<script src="https://cdn.bootcss.com/modernizr/2.8.2/modernizr.min.js"></script>-->

    <!-- Hotjar Tracking Code for http://xpay.exrick.cn/ -->
    <script>
        (function (h, o, t, j, a, r) {
            h.hj = h.hj || function () {
                (h.hj.q = h.hj.q || []).push(arguments)
            };
            h._hjSettings = {hjid: 734009, hjsv: 6};
            a = o.getElementsByTagName('head')[0];
            r = o.createElement('script');
            r.async = 1;
            r.src = t + h._hjSettings.hjid + j + h._hjSettings.hjsv;
            a.appendChild(r);
        })(window, document, 'https://static.hotjar.com/c/hotjar-', '.js?sv=');
    </script>

</head>

<body data-spy="scroll" data-target=".navbar-collapse" style="background:#f1f2f7">

<div class="culmn">
    <!--Home page style-->

<!--    <nav class="navbar navbar-default bootsnav navbar-fixed white no-background"-->
<!--         style="border-bottom: solid 1px #e0e0e0;background-color: #fff;">-->
<!--        <div class="container">-->

            <!-- Start Atribute Navigation -->
<!--            <div class="attr-nav">-->
<!--                <ul>-->
<!--                    <li><a href="https://github.com/Exrick/xpay" target="_blank" title="Github"><i class="fa fa-github"-->
<!--                                                                                                   style="font-size:21px"></i></a>-->
<!--                    </li>-->
<!--                    <li><a href="http://blog.exrick.cn" target="_blank" title="作者博客"><i class="fa fa-user-circle"-->
<!--                                                                                            style="font-size:18px"></i></a>-->
<!--                    </li>-->
<!--                    <li><a><i class="fa fa-qrcode" data-container="body" data-content="<img src='assets/images/qq-qr.png' width='200'>"-->
<!--                              data-html="true" data-placement="bottom" data-toggle="popover"-->
<!--                              data-trigger="hover" style="font-size:19px"-->
<!--                              title="免费交流群 562962309"></i></a></li>-->
<!--                </ul>-->
<!--            </div>-->
            <!-- End Atribute Navigation -->


            <!-- Start Header Navigation -->
<!--            <div class="navbar-header">-->
<!--                <button class="navbar-toggle" data-target="#navbar-menu" data-toggle="collapse" type="button">-->
<!--                    <i class="fa fa-bars"></i>-->
<!--                </button>-->
<!--                <a class="navbar-brand" href="index">-->
<!--                    <img alt="" class="logo logo-display" src="assets/images/footer-logo.png">-->
<!--                    <img alt="" class="logo logo-scrolled" src="assets/images/footer-logo.png">-->
<!--                </a>-->

<!--            </div>-->
            <!-- End Header Navigation -->

            <!-- navbar menu -->
<!--            <div class="collapse navbar-collapse" id="navbar-menu">-->
<!--                <ul class="nav navbar-nav navbar-center">-->
<!--                    <li><a href="index">首页</a></li>-->
<!--                    <li><a href="pay">支付体验</a></li>-->
<!--                    <li><a href="thanks">订单列表</a></li>&lt;!&ndash;-->
<!--                            <li><a href="http://xmall.exrick.cn" target="_blank">XMall商城</a></li>-->
<!--                            <li><a href="http://xboot.exrick.cn" target="_blank">XBoot开发平台</a></li>-->
<!--                            <li><a href="https://github.com/Exrick/xpay" target="_blank">开发教程</a></li>&ndash;&gt;-->
<!--                </ul>-->
<!--            </div>&lt;!&ndash; /.navbar-collapse &ndash;&gt;-->
<!--        </div>-->
<!--    </nav>-->

    <!--Featured Section-->
    <section class="features" id="features">
        <div class="container">
            <div class="row">
                <div class="main_features p-top-100">

                    <div class="gray-box">
                        <div class="title">
                            <h2>确认订单</h2>
                        </div>
                        <!--内容-->
                        <div>
                            <div class="order-info">
                                <h3>提交订单成功，请填写捐赠信息</h3>
                                <p class="payment-detail">
                                    为减轻后台压力，支付不起的小伙伴将在次日10:00AM统一收到支付结果邮件通知</p>
                                <!--#5c81e3-->
                                <p class="payment-detail" style="color: red;">
                                    成功支付≥10.00￥系统自动将【最新XPay源码(含文档)及个人申请官方接口教程】发至您填写的邮箱</p>
                                <p class="payment-detail" style="margin-bottom: 20px;">
                                    <a href="/dmf-detail" target="_blank">个人申请支付宝当面付说明</a>
                                    <a href="/wx-detail" style="margin-left: 30px;"
                                       target="_blank">个人申请微信官方接口说明</a>
                                </p>
                                <!--<p class="payment-detail"style="margin-bottom: 20px;" >-->
                                <!--成功支付≥68.00￥系统自动将作者开发的【微信小程序商城(不含后台)】发至您填写的邮箱-->
                                <!--<a href="https://v.qq.com/x/page/f0627kf4x1e.html" target="_blank">预览视频</a></p>-->
                                <div class="pay-info">
                                    <div class="form">
                                        <div class="form-group">
                                            <label class="control-label col-sm-3" for="nickName">昵称<span
                                                    class="red-txt"> *</span></label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="nickName" maxlength="20" name="nickName"
                                                       placeholder="请输入您的昵称" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-sm-3" for="money-choose">捐赠金额<span
                                                    class="red-txt"> *</span></label>
                                            <div class="col-sm-9">
                                                <select class="form-control m-bot15" id="money-choose"
                                                        onchange="chooseMoney()">
                                                    <option id="payTest" selected value="0.10">￥0.10 测试</option>
                                                    <option value="10.00">￥10.00（最新XPay及个人申请官方接口教程）
                                                    </option>
                                                    <!--<option value="68.00">￥68.00（含小程序商城）</option>-->
                                                    <option value="198.00">￥198.00 XBoot开发平台完整版（仅供学习）
                                                    </option>
                                                    <option value="custom">自定义 随意撒币</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="form-group" id="custom-input" style="display: none">
                                            <label class="control-label col-sm-3" for="money-choose">请输入金额<span
                                                    class="red-txt"> *</span></label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="money" maxlength="20" name="money"
                                                       oninput="toMoney()" placeholder="请确认您的支付金额(支持小数点后2位)"
                                                       type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group" id="email-input">
                                            <label class="control-label col-sm-3" for="email">您的邮箱<span
                                                    class="red-txt"> *</span></label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="email" maxlength="30" name="email"
                                                       placeholder="支付结果及源码将发送至您邮箱(推荐QQ邮箱)"
                                                       type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="control-label col-sm-3" for="email">留言</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="info" maxlength="50" name="info"
                                                       placeholder="请输入您的留言内容" type="text"/>
                                            </div>
                                        </div>
                                        <div class="form-group" id="test-input" style="display: none">
                                            <label class="control-label col-sm-3" for="email" style="color:#5c81e3">体验管理员邮箱</label>
                                            <div class="col-sm-9">
                                                <input class="form-control" id="testEmail" maxlength="30" name="testEmail"
                                                       placeholder="填写后您作为假管理员将收到审核邮件" type="text"/>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="pay-type">
                                    <div class="p-title">支付方式</div>
                                    <div class="pay-item">
<!--                                        <div class="active" id="dmf" onclick="changeType(0)"><img-->
<!--                                                alt="" src="assets/images/alipaydmf.png"></div>-->
<!--                                        <div class="" id="wx" onclick="changeType(1)"><img-->
<!--                                                alt="" src="assets/images/weixin.png"></div>-->
                                        <div class="active" id="qq" onclick="changeType(2)"><img alt=""
                                                                                           src="assets/images/qq.png"></div>
<!--                                        <div class="" id="uni" onclick="changeType(3)"><img alt=""-->
<!--                                                                                            src="assets/images/uni.png"></div>-->
<!--                                        <div class="" id="dian" onclick="changeType(4)"><img-->
<!--                                                alt="" src="assets/images/diandan.png"></div>-->
<!--                                        <div class="" id="ali" onclick="changeType(5)"><img-->
<!--                                                alt="" src="assets/images/alipay.png"></div>-->
<!--                                        <div class="" id="wechat" onclick="changeType(6)"><img-->
<!--                                                alt="" src="assets/images/wechat.png"></div>-->
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div>
                            <div class="box-inner">
                                <div>
                                        <span>
                                          应付金额：
                                        </span>
                                    <em><span>¥</span><em id="realMoney"></em></em>
                                    <input class="main-btn" id="submit" onclick="submit()" readonly type="text"
                                           value="立刻支付">
                                </div>
                            </div>
                        </div>

                    </div>

                </div>
            </div><!-- End off row -->
        </div><!-- End off container -->
    </section><!-- End off Featured Section-->

    <!-- scroll up-->
<!--    <div class="scrollup">-->
<!--        <a href="#"><i class="fa fa-chevron-up"></i></a>-->
<!--    </div>&lt;!&ndash; End off scroll up &ndash;&gt;-->


<!--    <footer class="footer bg-black" id="footer">-->
<!--        <div class="container">-->
<!--            <div class="row">-->
<!--                <div class="col-md-12">-->
<!--                    <nav class="navbar navbar-default bootsnav footer-menu no-background">-->
<!--                        <div class="container">-->

<!--                            &lt;!&ndash; Start Atribute Navigation &ndash;&gt;-->
<!--                            <div class="attr-nav">-->
<!--                                <ul>-->
<!--                                    <li>-->
<!--                                        <a href="https://github.com/Exrick/xpay" target="_blank" title="Github">-->
<!--                                            <i class="fa fa-github" style="font-size:21px"></i>-->
<!--                                        </a>-->
<!--                                    </li>-->
<!--                                    <li>-->
<!--                                        <a href="http://blog.exrick.cn" target="_blank" title="作者博客">-->
<!--                                            <i class="fa fa-user-circle" style="font-size:18px"></i>-->
<!--                                        </a>-->
<!--                                    </li>-->
<!--                                    <li>-->
<!--                                        <a>-->
<!--                                            <i class="fa fa-qrcode" data-container="body" data-content="<img src='assets/images/qq-qr.png' width='150'>"-->
<!--                                               data-html="true" data-placement="top" data-toggle="popover"-->
<!--                                               data-trigger="hover"-->
<!--                                               style="font-size:19px"-->
<!--                                               title="免费交流群 562962309"></i>-->
<!--                                        </a>-->
<!--                                    </li>-->
<!--                                </ul>-->
<!--                            </div>-->
                            <!-- End Atribute Navigation -->


                            <!-- Start Header Navigation -->
<!--                            <div class="navbar-header">-->
<!--                                <button class="navbar-toggle" data-target="#navbar-footer" data-toggle="collapse"-->
<!--                                        type="button">-->
<!--                                    <i class="fa fa-bars"></i>-->
<!--                                </button>-->
<!--                                <a class="navbar-brand" href="index"><img alt=""-->
<!--                                                                          class="logo" src="assets/images/footer-logo.png"></a>-->
<!--                            </div>-->
                            <!-- End Header Navigation -->

                            <!-- navbar menu -->
<!--                            <div class="collapse navbar-collapse" id="navbar-footer">-->
<!--                                <ul class="nav navbar-nav navbar-center">-->
<!--                                    <li><a href="index">首页</a></li>-->
<!--                                    <li><a href="pay">支付体验</a></li>-->
<!--                                    <li><a href="thanks">订单列表</a></li>&lt;!&ndash;-->
<!--                                            <li><a href="http://xmall.exrick.cn" target="_blank">XMall商城</a></li>-->
<!--                                            <li><a href="http://xboot.exrick.cn" target="_blank">XBoot开发平台</a></li>-->
<!--                                            <li><a href="https://github.com/Exrick/xpay" target="_blank">开发教程</a></li>&ndash;&gt;-->
<!--                                </ul>-->
<!--                            </div>&lt;!&ndash; /.navbar-collapse &ndash;&gt;-->
<!--                        </div>-->
<!--                    </nav>-->
<!--                </div>-->
<!--                <div class="divider"></div>-->
<!--                <div class="col-md-12">-->
<!--                    <div class="main_footer text-center p-top-40 p-bottom-30">-->
<!--                        <p class="wow fadeInRight" data-wow-duration="1s">-->
<!--                            <a href="http://blog.exrick.cn/" target="_blank">xpay.exrick.cn </a> ©2017-Present. All-->
<!--                            Rights Reserved-->
<!--                        </p>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--        </div>-->
<!--    </footer>-->

    <!-- Modal -->
    <div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="myModal" role="dialog" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
                    <h4 class="modal-title" id="title">提示</h4>
                </div>
                <div class="modal-body" id="body">
                </div>
                <div class="modal-footer">
                    <button class="btn btn-warning" data-dismiss="modal" type="button">确 认</button>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal -->
    <div aria-hidden="true" aria-labelledby="myModalLabel" class="modal fade" id="emailModal" role="dialog"
         tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button aria-hidden="true" class="close" data-dismiss="modal" type="button">&times;</button>
                    <h4 class="modal-title">温馨提示</h4>
                </div>
                <div class="modal-body">
                    您填写的邮箱非QQ邮箱，可能支付结果邮件会被拦截至垃圾邮件或发送失败，建议更换为QQ邮箱！
                </div>
                <div class="modal-footer">
                    <button class="btn" data-dismiss="modal" onclick="sendRequest()" type="button">继续支付</button>
                    <button class="btn btn-warning" data-dismiss="modal" type="button">去更换邮箱</button>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- JS includes -->

<!--<script src="assets/js/vendor/jquery-1.11.2.min.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!--<script src="assets/js/vendor/bootstrap.min.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>

<!--<script src="assets/js/jquery.magnific-popup.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.0.1/jquery.magnific-popup.min.js"></script>
<!--<script src="assets/js/jquery.easing.1.3.js"></script>-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-easing/1.3/jquery.easing.compatibility.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.0/js/swiper.jquery.min.js"></script>

<script src="assets/js/jquery.collapse.js"></script>
<script src="assets/js/bootsnav.js"></script>

<script src="assets/js/plugins.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/jquery.cookie.js"></script>

</body>
<script>
    $("[data-toggle='popover']").popover();

    $("#money-choose").val("10.00");
    var url = window.location.href;
    if (url.indexOf("xboot") >= 0) {
        $("#money-choose").val("198.00");
    }

    var nickName = "", money = "", email = "", testEmail = "", payType = "DMF", picName = "",
        custom = false, mobile = false, DMF = false;
    // 支付时间倒计时
    var setTime = 120;

    // 判断移动设备
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
        mobile = true;
        // 判断移动设备 3分钟支付时间
        setTime = 180;
    }

    // 判断是否支付宝内打开
    function isAlipay() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.indexOf("alipay") >= 0) {
            return 1;
        }
        return 0;
    }

    // 判断是否微信浏览器
    function isWeixin() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == 'micromessenger') {
            return 1;
        }
        return 0;
    }

    function check() {
        nickName = $("#nickName").val();
        money = $("#money").val();
        email = $("#email").val();
        testEmail = $("#testEmail").val();

        var v = $("#money-choose").val();
        if (nickName == "" && v == "0.10") {
            showMsg('请填写昵称');
            return false;
        }
        if (nickName == "" || email == "" && v != "0.10") {
            showMsg('请填写昵称和邮箱，若邮箱填写错误您将无法收到支付结果');
            return false;
        }
        if (picName == "custom") {
            if (!isMoney(money)) {
                showMsg('请填写正确的金额（支持2位小数，金额不得低于10.00元）');
                return false;
            }
        }
        if (!isEmail(email) && v != "0.10") {
            showMsg('请填写正确的通知邮箱地址');
            return false;
        }
        if (testEmail != "" && !isEmail(testEmail)) {
            showMsg('请填写正确的体验管理员邮箱地址');
            return false;
        }
        return true;
    }

    function isMoney(v) {
        if (v == "" || v == null) {
            return false;
        }
        var regu = /(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/
        var re = new RegExp(regu);
        if (re.test(v)) {
            return true;
        } else {
            return false;
        }
    }

    function isEmail(v) {
        var regu = /^\w+@[a-zA-Z0-9]{2,10}(?:\.[a-z]{2,4}){1,3}$/
        var re = new RegExp(regu);
        if (re.test(v)) {
            return true;
        } else {
            return false;
        }
    }

    function toMoney() {
        money = $("#money").val();
        if (money == "") {
            $("#realMoney").html("0.00");
            return;
        }
        money = parseFloat(money);
        money = money.toFixed(2);
        money = money.toLocaleString();
        $("#realMoney").html(money);
        return money;
    }

    chooseMoney();

    function chooseMoney() {
        var v = $("#money-choose").val();
        picName = v;
        $.cookie('picName', v);

        if (v == "0.10") {
            $("#email-input").css("display", "none");
        } else {
            $("#email-input").css("display", "block");
        }

        if (v == "custom") {
            custom = true;
            $("#custom-input").css("display", "block");
        } else {
            custom = false;
            if (v == "") {
                $("#realMoney").html("0.00");
                return;
            }
            v = parseFloat(v);
            v = v.toFixed(2);
            v = v.toLocaleString();
            $("#realMoney").html(v);
            money = v;

            $("#custom-input").css("display", "none");
        }
    }

    function changeType(v) {
        $("#money-choose").val("10.00");
        chooseMoney();
        if (v == 0) {
            payType = "DMF";
            $("#dmf").attr("class", "active");
            $("#wx").removeAttr("class");
            $("#ali").removeAttr("class");
            $("#wechat").removeAttr("class");
            $("#qq").removeAttr("class");
            $("#uni").removeAttr("class");
            $("#dian").removeAttr("class");
            $("#test-input").css("display", "none");
            $("#payTest").css("display", "block");
        } else if (v == 1) {
            payType = "Wechat(Official)";
            $("#wx").attr("class", "active");
            $("#ali").removeAttr("class");
            $("#dmf").removeAttr("class");
            $("#wechat").removeAttr("class");
            $("#qq").removeAttr("class");
            $("#uni").removeAttr("class");
            $("#dian").removeAttr("class");
            $("#test-input").css("display", "none");
            $("#payTest").css("display", "block");
        } else if (v == 2) {
            payType = "QQ";
            $("#ali").removeAttr("class");
            $("#dmf").removeAttr("class");
            $("#wx").removeAttr("class");
            $("#wechat").removeAttr("class");
            $("#qq").attr("class", "active");
            $("#uni").removeAttr("class");
            $("#dian").removeAttr("class");
            $("#test-input").css("display", "block");
            $("#payTest").css("display", "none");
        } else if (v == 3) {
            payType = "UnionPay";
            $("#ali").removeAttr("class");
            $("#dmf").removeAttr("class");
            $("#wx").removeAttr("class");
            $("#wechat").removeAttr("class");
            $("#qq").removeAttr("class");
            $("#uni").attr("class", "active");
            $("#dian").removeAttr("class");
            $("#test-input").css("display", "block");
            $("#payTest").css("display", "none");
        } else if (v == 4) {
            payType = "Diandan";
            $("#ali").removeAttr("class");
            $("#dmf").removeAttr("class");
            $("#wx").removeAttr("class");
            $("#wechat").removeAttr("class");
            $("#qq").removeAttr("class");
            $("#uni").removeAttr("class");
            $("#dian").attr("class", "active");
            $("#test-input").css("display", "block");
            $("#payTest").css("display", "none");
        } else if (v == 5) {
            payType = "Alipay";
            $("#ali").attr("class", "active");
            $("#dmf").removeAttr("class");
            $("#wx").removeAttr("class");
            $("#wechat").removeAttr("class");
            $("#qq").removeAttr("class");
            $("#uni").removeAttr("class");
            $("#dian").removeAttr("class");
            $("#test-input").css("display", "block");
            $("#payTest").css("display", "none");
        } else if (v == 6) {
            payType = "Wechat";
            $("#ali").removeAttr("class");
            $("#dmf").removeAttr("class");
            $("#wx").removeAttr("class");
            $("#wechat").attr("class", "active");
            $("#qq").removeAttr("class");
            $("#uni").removeAttr("class");
            $("#dian").removeAttr("class");
            $("#test-input").css("display", "block");
            $("#payTest").css("display", "none");
        }
    }

    function submit() {
        if (!check()) {
            return;
        }
        // 非测试时判断qq邮箱
        var v = $("#money-choose").val();
        if (v != "0.10" && email.indexOf("qq.com") < 0) {
            $("#emailModal").modal('show');
            return;
        } else {
            sendRequest();
        }
    }

    function sendRequest() {
        if (picName == "custom") {
            money = $("#money").val();
        } else {
            money = picName;
        }
        $.cookie('money', money);
        $.cookie('time', setTime);

        // 支付宝风控 v1.6起改为转账码 不支持固码
        if (payType == "Alipay") {
            custom = true;
//                $.cookie('picName', "custom");
        }

        $("#submit").attr("disabled", "disabled");
        $("#submit").val("提交中...");
        if (payType == "DMF") {
            $.cookie('time', 300);
            $.ajax({
                url: "/alipay/precreate",
                type: 'POST',
                data: {
                    nickName: nickName,
                    money: money,
                    email: email,
                    payType: payType,
                    info: $("#info").val(),
                    custom: custom,
                    mobile: mobile,
                    device: navigator.userAgent
                },
                success: function (data) {
                    if (data.success == true) {
                        // 存入id和qrCode
                        $.cookie('payId', data.result.id);
                        $.cookie('qrCode', data.result.qrCode);
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        if (isAlipay()) {
                            window.location.href = data.result.qrCode;
                        } else {
                            window.location.href = "/dmf";
                        }
                    } else {
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        showMsg(data.message);
                    }
                },
                error: function (XMLHttpRequest) {
                    if (XMLHttpRequest.status != 200) {
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        alert('出错啦! 错误码:' + XMLHttpRequest.status);
                    }
                }
            });
        } else if (payType == "Wechat(Official)") {
            $.cookie('time', 300);
            $.ajax({
                url: "/wechat/precreate",
                type: 'POST',
                data: {
                    nickName: nickName,
                    money: money,
                    email: email,
                    payType: payType,
                    info: $("#info").val(),
                    custom: custom,
                    mobile: mobile,
                    device: navigator.userAgent
                },
                success: function (data) {
                    if (data.success == true) {
                        // 存入id和qrCode
                        $.cookie('payId', data.result.id);
                        $.cookie('qrCode', data.result.qrCode);
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        if (isWeixin()) {
                            window.location.href = data.result.qrCode;
                        } else {
                            window.location.href = "/wx";
                        }
                    } else {
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        showMsg(data.message);
                    }
                },
                error: function (XMLHttpRequest) {
                    if (XMLHttpRequest.status != 200) {
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        alert('出错啦! 错误码:' + XMLHttpRequest.status);
                    }
                }
            });
        } else {
            $.ajax({
                url: "/pay/add",
                type: 'POST',
                data: {
                    nickName: nickName,
                    money: money,
                    email: email,
                    testEmail: testEmail,
                    payType: payType,
                    info: $("#info").val(),
                    custom: custom,
                    mobile: mobile,
                    device: navigator.userAgent
                },
                success: function (data) {
                    if (data.success == true) {
                        // 存入num和id
                        $.cookie('payNum', data.result.payNum);
                        $.cookie('payId', data.result.id);
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        if (payType == "Alipay") {
                            if (isAlipay()) {
                                window.location.href = "alipays://platformapi/startapp?appId=20000067&url=" +
                                    encodeURIComponent("http://xpay.exrick.cn/openAlipay?money=" + money + "&num=" + data.result.payNum + "&id=" + data.result.id);
                            } else {
                                window.location.href = "/alipay";
                            }
                        } else if (payType == "Wechat") {
                            window.location.href = "/wechat";
                        } else if (payType == "QQ") {
                            window.location.href = "/qqpay";
                        } else if (payType == "UnionPay") {
                            // 重新存入价格信息
                            $.cookie('money', money - Number(data.result.payNum) * 0.1);
                            $.cookie('originPrice', money);
                            window.location.href = "/unipay";
                        } else if (payType == "Diandan") {
                            window.location.href = "/diandan";
                        }
                    } else {
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        showMsg(data.message);
                    }
                },
                error: function (XMLHttpRequest) {
                    if (XMLHttpRequest.status != 200) {
                        $("#submit").removeAttr("disabled");
                        $("#submit").val("立刻支付");
                        alert('出错啦! 错误码:' + XMLHttpRequest.status);
                    }
                }
            });
        }
    }

    function showMsg(m) {
        $("#myModal").modal('show');
        $("#body").html(m);
    }
</script>
</html>
